<template>
	<view>
		<view class="u-input">
			<view class="u-input_in" :style="{width:wid}">
				<i class="icon iconColor">&#xe614;</i>
				<input 
				   placeholder="请输入搜索条件" 
				   :style="{width:inputWid}"
				   class="textColor input_input" 
				   v-model="search" 
				   placeholder-class="placeholderColor"/>
				<view class="u-input_clear" v-if="search" @tap.stop="search = ''">
					<i class="icon size36 iconColor">&#xe600;</i>
				</view>
			</view>
			<!-- <view class="u-btn" v-show="search" @tap="$emit('input',search)">
				搜索
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			wid:{
				type:String,
				default:'456rpx'
			},
			inputWid:{
				type:String,
				default:'280rpx'
			}
		},
		data() {
			return {
				search:''
			};
		},
		watch: {
			search(newVal){
				this.$emit('input', newVal)
			}
		},
	}
</script>

<style lang="scss">
	@import '@/static/css/input.scss';
</style>
